﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataMappers;
using ExaminationTT.Model;


namespace ConcreteMappersAndObjects.DomainObjects
{
    public class Regime : DomainObject<int, Regime> , IRegime
    {
        private string _description;
        private IEnumerable<SClass> _classes;

        protected override Regime Self()
        {
            return this;
        }

        #region IRegime Members

        public Regime() : base() { }

        public Regime(int ID, string description, IEnumerable<SClass> classes) : base(ID)
        {
            Description = description;
            _classes = classes;
        }
        public string Description
        {
            get { return _description; }
            set { _description = value; MarkDirty(); }
        }

        public IEnumerable<SClass> Classes
        {
            get{ return _classes.ToArray();}
            private set { _classes = value; }
        }

        #endregion

        #region IRegime Members

        string IRegime.Description
        {
            get { return _description; }
        }

        IEnumerable<IClass> IRegime.Classes
        {
            get { return _classes.ToList(); }
        }

        #endregion
    }
}
